#include<stdio.h>
#include<math.h>
int main()
{
    int way1(int n);
    int way2(int n);
    int num;
    scanf("%d\n",&num);
    printf("%d\n%d\n",way1(num),way2(num));
}
int way2(int n)
{
    int n1,k,i,m=0;
    for(n1=1;n1<=n;n=n+2)
    {
        k=sqrt(n1);
        for(i=2;i<=k;i++)
        if(n%i==0) break;
            if(i>=k+1)
                m=m+1;
    }
    return m;
}
int way1(int n)
{
    int count=0;
    int i=0;
    for(i=2;i<n;i++)
    {
        if(n%i==0)
            continue;
        else if(i<n)
            continue;
        else
            count=count+1;
    }
    printf("%d\n",count);
}